<script setup lang="ts">
import echart from './component/echart.vue'
import useSwiperStore from '@/store/modules/swiper'

const useSwiper = useSwiperStore()
useSwiper.getAllSwiper()
</script>

<template>
  <div>
    <el-card class="swiper-card">
      <el-carousel :interval="5000" height="500px">
        <el-carousel-item v-for="(item, i) in useSwiper.imageUrl" :key="i">
          <img
            v-if="useSwiper.imageUrl[i]"
            :src="useSwiper.imageUrl[i]"
            class="swiper"
          />
        </el-carousel-item>
      </el-carousel>
    </el-card>
    <el-card style="margin-top: 12px">
      <div class="centerDetail">
        <el-card class="el_card_item" shadow="hover">
          <template #header>
            <div class="card-header">
              <span>Card name</span>
            </div>
          </template>
          <p v-for="o in 4" :key="o" class="text item">
            {{ 'List item ' + o }}
          </p>
          <template #footer>Footer content</template>
        </el-card>
        <el-card class="el_card_item" shadow="hover">
          <template #header>
            <div class="card-header">
              <span>Card name</span>
            </div>
          </template>
          <p v-for="o in 4" :key="o" class="text item">
            {{ 'List item ' + o }}
          </p>
          <template #footer>Footer content</template>
        </el-card>
        <el-card class="el_card_item" shadow="hover">
          <echart />
        </el-card>
      </div>
    </el-card>
  </div>
</template>

<style scoped lang="scss">
.swiper-card {
  --el-card-padding: 0px;
}

.centerDetail {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-around;

  .el_card_item {
    height: 380px;
    width: 400px;
  }
}

.swiper {
  width: 1342px;
  height: 540px;
}
</style>
<style scoped>
.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>
